Chapter 9 - Semantic Events and Scripting
This is the seventh of eight chapters that discuss the OpenDoc programming interface in detail. This chapter describes the scripting support provided for your parts by OpenDoc.Before reading this chapter, you should be familiar with the concepts presented in Chapter 1, "Introduction to OpenDoc," and Chapter 2, "Development Overview." For additional concepts related to your part editor's runtime environment, see Chapter 11, "OpenDoc Runtime Features."
Scripting support is one example of the use of the OpenDoc extension interface. Extending OpenDoc through its extension interface is described in general terms in Chapter 10, "Extending OpenDoc."
This chapter first summarizes the Open Scripting Architecture and OpenDoc scripting in general. It then describes the OpenDoc semantic interface, a set of classes, utilities, and handlers you can take advantage of in implementing your support for scripting. The chapter then describes how to write and install
The chapter concludes with a discussion of how to construct object specifiers and send semantic events from your part.
- semantic-event handlers
- object accessors
- object-callback functions, coercion handlers, and predispatch handlers
All discussion in this chapter is specific to the Mac OS platform. The explana-
tions in this chapter extend the discussions of Apple events, the Apple event object model, and the Open Scripting Architecture presented in Inside Macintosh: Interapplication Communication. It is assumed that you are already familiar with, or have access to, the descriptions of Mac OS scripting found in that book.
Chapter Contents
- Scripting and OpenDoc
- The Open Scripting Architecture
- Apple Events
- Apple Event Object Model
- Scripting Systems
- Part Content Model
- Content Operations
- Content Objects
- Resolving Object References
- Levels of Scripting Support
- Scriptable Parts
- Recordable Parts
- Customizable Parts
- The OpenDoc Semantic Interface
- Scripting-Related OpenDoc Classes
- Scripting-Related Utility Classes
- The Default Semantic Interface
- The Default Get Data and Set Data Event Handlers
- Default Object Accessors
- Standard Embedded-Frame Token
- Implementing Your Semantic Interface
- Writing Semantic-Event Handlers
- Writing Object Accessors
- Object Resolution
- A. Message Interface Calls Resolve
- B. Resolve Locates the Proper Object
- C. OpenDoc Calls the Correct Event Handler
- Returning Tokens
- Returning a Swap Token
- Other Considerations
- Writing Other Kinds of Handlers
- Object-Callback Functions
- Coercion Handlers
- Predispatch Handlers and Recording
- Installation
- Making Your Semantic-Interface Extension Available
- Installing Handlers, Accessors, and Callbacks
- Installing System-Level Handlers
- Making Your Terminology Resource Available
- Sending Semantic Events
- Constructing Object Specifiers
- Using CreatePartObjSpec
- Using EmbeddedFrameSpec
- Using Persistent Object ID
- Sending the Event
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help